package cn.catsdad.dto;

import cn.catsdad.entity.User;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/**
 * 用户dto
 *
 * @author xuyonglong
 * @version V1.0 2023/3/23
 */
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "tb_auth_user")
@Data
public class UserDTO extends User {

    /**
     * 所属部门id
     */
    @Transient
    private Long departmentId;

    /**
     * 岗位id
     */
    @Transient
    private Collection<Long> positionIds;

    /**
     * 批量操作的id
     */
    @Transient
    private Collection<Long> ids;

    /**
     * 当前用户已经绑定的角色
     */
    @Transient
    private List<RoleDTO> roles = new ArrayList<>();

    /**
     * 旧密码
     */
    @Transient
    private String oldPassword;
}
